package com.ebt.m.wiki;

import android.os.Bundle;

import com.ebt.m.R;
import com.ebt.m.activity.BaseToolBarActivity;
import com.ebt.m.data.bean.Brand;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.ButterKnife;


/**
 * Created by Damon.Han on 2017/1/18 0018.
 *
 * @author Damon
 */

public class ActSpecProductLibFilter extends BaseToolBarActivity {
    @BindView(R.id.recycler_view)
    SpecProductFilterView filterView;

    private Brand selectedBrand;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.product_spec_lib_filter);
        ButterKnife.bind(this);
    }

    @Override
    protected void init() {
        super.init();
        initViews();
        initDatas();
    }

    public void initViews() {
        setTitle("筛选产品");
        setNaviIcon(R.drawable.icon_navi_wrong);
    }

    public void initDatas() {
        if (getIntent().getSerializableExtra("currentBrand") != null) {
            selectedBrand = (Brand) getIntent().getSerializableExtra("currentBrand");
        }
        filterView.update(selectedBrand, 2);
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }
}
